SQL Editor - Build Query
Here you can design a query visually while Argos creates the actual SQL code for you.
- Show Tables - Lists all tables and views in the database that are available to you.
- Show Unions - Lists all queries that have been created and joined together with a union statement. You can edit and add new union queries here as well.
- Add Table - If you know what table you will use in your query, use this button to type in the table name (or view name) to add it. This is generally much quicker than using the Show Tables button on databases with many objects.
- Add Query - Add a subquery (query within a query) to your conditional WHERE clause, or add an inline view subquery into the FROM clause.
Button | Name | Description |
---|---|---|
View SQL | See the SQL generated from the query you built in the visual designer. | |
Refresh | Refresh the tables in your Query. | |
Copy | Copies the entire visual design to the clipboard. This can be very useful if you created a Dashboard and would like to use the same query in your Report Query. | |
Paste | Pastes a visual design from the clipboard. This will overwrite the existing design. | |
Reorder Tables | Change the creation order of the tables on this form by moving them up or down the list. | |
Edit Query Properties | Modify data connection settings. It is recommended that these settings are left set as their defaults unless otherwise instructed by an Evisions support technician. |
- Visible Fields (SELECT) tab - Lists all of the fields that you are selecting from the database.
- Distinct - Add the distinct operator to your query.
- Summing - Turn summing functions on. Add Avg,Count, Max, Min, or Sum functions to a field. This will also set fields that are not using a group by function to Group By automatically. When you enable Summing options, the HAVING tab will be enabled (which allows you to limit based on aggregate functions).
- Add a field to your query - To add a field to a query you can either double click the column name in the table listing or use the Table and Field dropdowns to manually add them.
- Aliases - It is recommended that you alias fields to make them more user-friendly. Aliases are required for all fields when working with SQL Server databases. If you are using an inline view subquery within Oracle, and you assigned an alias to a field in your subquery, the alias will be enclosed within quotes by default. This is an Oracle convention. If you use this field within a report, you must create another alias for it, and omit the enclosing quotes.
- Calculated Fields - Create a calculated field by selecting
from the Table field. Here you can add fields other than standard columns. - Conditional Fields (WHERE) tab - Lists all of the conditional statements in your WHERE clause.
- Ordering (ORDER BY) tab - Determine the order that your query will return.
If you need additional help creating DataBlocks, refer to the Getting Started with DataBlocks page.
To read a step-by-step tutorial on how to create Unions, refer to Example 13 in the Argos DataBlock Designers Guide.
To read step-by-step tutorials on how to create subqueries, refer to Example 10 (Scalar Subquery), Example 11( Correlated Subquery), or Example 12 (Non-Correlated Subquery), in the DataBlock Designer Guide.